<p class="breadcrumbs"><strong>You are here:</strong> &raquo; <a href="<?php echo $gene_uri ?>"><?php _e($gene_name) ?></a> &raquo; Search</p>

<?php if ($errormsg): ?>
	<p class="errormessage"><?php _e($errormsg) ?></p>
<?php endif; ?>

<form action="<?php echo Gene::makeLink(Gene::specialId('Search')) ?>" method="get">
<input type="hidden" name="s" value="<?php echo Gene::specialId('Search') ?>" />
<?php if ($searchtype): ?>
	<input type="hidden" name="type" value="<?php _e($searchtype) ?>" />
<?php endif; ?>
<p><input type="text" name="q"<?php if ($searchterm): ?> value="<?php _e($searchterm) ?>"<?php endif; ?> /> <input type="submit" value="Search" /><br />
<?php foreach (Gene::getSetting("search_sources") as $i): ?>
	<label><input type="radio" name="type" value="<?php _e($i) ?>"<?php if ($searchtype == $i): ?> checked="checked"<?php endif; ?> /><?php _e(ucfirst($i)) ?></label>
<?php endforeach; ?></p>
</form>

<?php if ($search): ?>
	<?php if (count($results)): ?>
		<p>Results <strong><?php echo $currentpagestart ?> - <?php echo $currentpageend ?></strong> of about <strong><?php echo $numresults ?></strong> results:</p>
		
		<?php $resultno = $currentpagestart-1 ?>

		<?php foreach ($results as $i): ?>
			<p>
				<span class="resulttitle"><?php echo ++$resultno ?>. <a href="<?php echo $i['url'] ?>"><?php echo _e($i['title']) ?></a></span>
				<?php if ($i['snippet']): ?>
					<br /><span class="resultsnippet"><?php echo $i['snippet'] ?></span>
				<?php endif; ?>
				<?php if ($i['extra']): ?>
					<br /><span class="resultextra"><?php _e($i['extra']) ?></span>
				<?php endif; ?>
			</p>
		<?php endforeach; ?>
	<?php else: ?>
		<p>No results were found.</p>
		
		<p>Suggestions:</p>

		<ul>
		<li>Check your spelling</li>
		<li>Try refining your query using different or more general keywords</li>
		<li>Try <a href="http://www.google.com/search?q=<?php echo urlencode($searchterm) ?>">searching the web</a> for your query</li>
		</ul>
	<?php endif; ?>
	
	<?php echo getPager(array(
		"object" => Gene::specialId('Search'),
		"numpages" => $numpages,
		"currentpage" => $currentpage,
		"hidelast" => true,
		
		"q" => $searchterm,
	)) ?>
	
	<form action="<?php echo Gene::makeLink(Gene::specialId('Search')) ?>" method="get">
	<input type="hidden" name="s" value="<?php echo Gene::specialId('Search') ?>" />
	<?php if ($searchtype): ?>
		<input type="hidden" name="type" value="<?php _e($searchtype) ?>" />
	<?php endif; ?>
	<p><input type="text" name="q"<?php if ($searchterm): ?> value="<?php _e($searchterm) ?>"<?php endif; ?> /> <input type="submit" value="Search" /><br />
	<?php foreach (Gene::getSetting("search_sources") as $i): ?>
		<label><input type="radio" name="type" value="<?php _e($i) ?>"<?php if ($searchtype == $i): ?> checked="checked"<?php endif; ?> /><?php _e(ucfirst($i)) ?></label>
	<?php endforeach; ?></p>
	</form>
	
<?php endif; ?>